<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/mytable/Fk_cntr.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mytable/mytable/Fk_cntr.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'rcntr_id',
                footer: "Foots",
                cnName: '成本中心',
                name: 'mytable/Fk_cntr',
                url: "/Fk_cntr/",
                sortName: "rcntr_id"
            });
            const editFormFields = ref({"rcntr_no":"","rcntr":"","fzren":"","company_id":"","lstype":""});
            const editFormOptions = ref([[{"title":"成本中心编码","field":"rcntr_no"},
                               {"title":"成本中心说明","field":"rcntr"}],
                              [{"title":"负责人","field":"fzren","type":"text"},
                               {"title":"公司编码","field":"company_id","type":"number"}],
                              [{"title":"类型(ct成本中心，pr项目订单)","field":"lstype"}]]);
            const searchFormFields = ref({"rcntr_no":"","rcntr":"","fzren":"","company_id":"","lstype":""});
            const searchFormOptions = ref([[{"title":"成本中心编码","field":"rcntr_no","type":"like"},{"title":"成本中心说明","field":"rcntr","type":"like"}],[{"title":"负责人","field":"fzren"},{"title":"公司编码","field":"company_id","type":"number"}],[{"title":"类型(ct成本中心，pr项目订单)","field":"lstype","type":"text"}]]);
            const columns = ref([{field:'rcntr_id',title:'rcntr_id',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'rcntr_no',title:'成本中心编码',type:'string',link:true,width:110,align:'left',sort:true},
                       {field:'rcntr',title:'成本中心说明',type:'string',width:110,align:'left'},
                       {field:'fzren',title:'负责人',type:'string',width:110,align:'left'},
                       {field:'company_id',title:'公司编码',type:'int',width:80,align:'left'},
                       {field:'lstype',title:'类型(ct成本中心，pr项目订单)',type:'string',width:180,align:'left'}]);
            const detail = ref({
                cnName: "成本中心（子表）-部门授权",
                table: "Fk_rcntr_dep_auth",
                columns: [{field:'id',title:'id',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'depid_oa',title:'OA部门编号',type:'int',bind:{ key:'depart-oa',data:[]},width:110,edit:{type:'select'},align:'left',sort:true},
                       {field:'rcntr_id',title:'rcntr_id',type:'int',width:80,hidden:true,align:'left'}],
                sortName: "id",
                key: "id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
